#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
using namespace std;
int main() 
{
    long long L;
    cin >> L;
    int sum = 0, count = 0;
    for (int i = 2; i < 1000000; i++) 
    {
        bool isPrime = true;
        for (int j = 2; j <= sqrt(i); j++) 
        {
            if (i % j == 0) 
            {
                isPrime = false;
                break;
            }
        }
        if (isPrime) 
        {
            sum += i;
            if (sum > L) 
            {
                break;
            }
            count++;
            cout << i << endl;
        }
    }
    cout << count <<endl;
    return 0;
}